const getDate = (beginDate, endDate) => {
    return Math.floor((new Date(endDate).getTime() - new Date(beginDate).getTime()) / (1000 * 60 * 60 * 24));
}

const dayNum = getDate(new Date(2022, 11, 24, 0, 0, 0), new Date(2023, 6, 5, 0, 0, 0))
console.log((58.68 / dayNum) / 5000 * 365)